
#import <Foundation/Foundation.h>
#import "sdk_bi_constrains.h"
#include <libkern/OSAtomic.h>
#import  <CoreTelephony/CTCarrier.h>
#import  <CoreTelephony/CTTelephonyNetworkInfo.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <ifaddrs.h>

@interface SdkBiUtils : NSObject

+ (NSString *)jsonDataWithDict:(NSDictionary *)dict withDefaultValue:(NSString *)defValue;
+ (NSString *)currentSessionId;
+ (NSString *)currentBatchId;
+ (NSString *)copyString:(NSString *)str;
+ (NSString *)updateTarget:(NSString *)target withObject:(NSString *)object;
+ (BOOL)isEmptyString:(NSString *)inputString;
+ (BOOL)isNull:(id)object;
+ (void)setDictValue:(NSMutableDictionary *)dict withObject:(id)object forKey:(NSString *)key;
// ios 7 之后，mac地址apple统一返回"02:00:00:00:00:00"
+ (NSString *)macAddress;
+ (NSString *)channelIDFromInfoPlist;
+ (NSString *)infoPlistValueForKey:(NSString *)key;
+ (NSString *)sdkAppKeyFromInfoPlist;


+ (NSString *)sdkBtAppIDFromInfoPlist;
+ (NSString *)sdkAppIDFromInfoPlist;
+ (BOOL)sdkIDFAFromInfoPlist;
+ (NSString *)dataUrlFromInfoPlist;
+ (NSString *)deviceId;
+ (NSString *)osVersion;
+ (NSString *)systemOS;
+ (NSString *)bundleIdentifier;
+ (NSString *)getChipType;
// 20230510近期出现闪退，暂时不调用此api
+ (NSString *)networkTypeFromStatusBar;
+ (NSString *)localIPAddress;
+ (NSString *)getIPAddress:(BOOL)preferIPv4;
+ (NSString *)appVersion;
+ (NSString *)buildVersion;
+ (NSString *)cpuFreq;
+ (NSString *)totalMemory;
+ (NSString *)screenSize;
+ (NSString *)carrier;
+ (NSString *)countryCode;
+ (NSString *)language;
+ (NSString *)currentTime;
// 生成36位随机字符串，例：2720A216-3D3A-427D-B739-D5AF61B2D4C9
+ (NSString *)randomUUID;
+ (NSString *)HMACSHA1WithData:(NSData *)data withKey:(NSString *)key;
+ (NSString *)hmacSha1:(NSString *)key text:(NSString *)text;
+ (NSDictionary *)getObjectData:(id)obj;
+ (NSData *)AES256EncryptWithPlainText:(NSData *)plainText withKey:(NSString *)key;        /*加密方法,参数需要加密的内容*/
+ (NSData *)encryptModeDES:(NSData *)plainText key:(NSString *)key;
//md5加密
+ (NSString *)md5Digest:(NSString *)str;
//获得设备型号
+ (NSString *)getCurrentDeviceModel;
+ (NSString *)getDeviceType:(NSString*)deviceModel;
+ (NSString *)getNowTimeTimestamp;
+ (void)setUserAgent;
+ (NSString *)getUserAgent;
+ (NSString *)getUserAgentError;

#pragma mark - ASA相关
+ (BOOL)sdkASAKeyFromInfoPlist;
+ (NSInteger)sdkASAStatus;
+ (void)setSDKASAStatus:(NSInteger)status;
+ (void)setASAData:(NSDictionary *)dict;
+ (void)deleteASAData;
+ (NSDictionary *)getASAData;
+ (void)saveHistoryASA:(NSDictionary *)dict;
+ (NSDictionary *)getHistoryASAData;

#pragma mark - ca
/**
 * 开机启动时间
 */
+ (NSString *)bootTimeInSec;
+ (NSString *)deviceNameMD5;
+ (NSString* )carrierInfo;
+ (NSString *)memory;
+(NSString *)machine;
+ (NSString *)disk;
+ (NSString *)sysFileTime;
+ (NSString *)model;
+ (NSString *)timeZone;
+ (NSString *)fileInitTime;
+ (NSString *)mntId;
@end
